<template>
  <div class="cart" v-show="token">
    <div class="head">
      <h1>购物车</h1>
    </div>
    <div class="content">
      <div class="img">
        <span></span>
      </div>
      <h3>购物车暂无商品</h3>
      <p>添加到购物车的商品将会显示在这里</p>
      <div class="bts">
        <router-link tag="div" to="/home" class="right">
          <span>现在购买</span>
        </router-link>
      </div>
    </div>
    <buttomtag :buttomindex="buttomindex"></buttomtag>
  </div>
</template>

<script>
import buttomtag from "../components/TestoCom.vue";

export default {
  data() {
    return {
      buttomindex: null,
      token:null,
    };
  },

  methods: {},
  components: {
    buttomtag,
  },
  created() {
    this.buttomindex = this.$route.query.index;
    console.log(window.localStorage.getItem('taken'));
    this.token=window.localStorage.getItem('taken')
  },
};
</script>

<style lang="scss" scoped>
.cart {
  .head {
    width: 100%;
    height: 50px;
    border-bottom: 1px solid #dbdbdb;
    h1 {
      width: 70%;
      margin: 0 auto;
      text-align: center;
      line-height: 50px;
      color: rgba(0, 0, 0, 0.6);
      font-size: 18px;
      font-weight: 700;
    }
  }
  .content {
    width: 100%;

    .img {
      width: 40%;
      margin: 0 auto;
      margin-top: 120px;
      height: 200px;
      // background-color: aqua;
      span {
        display: block;
        width: 100%;
        height: 190px;
        background-image: url(../assets/img/gwucart.png);
        background-repeat: no-repeat;
        background-size: cover;
      }
    }
    h3 {
      width: 50%;
      color: rgba(0, 0, 0, 0.15);
      font-weight: 700;
      margin: 0 auto;
      text-align: center;
    }
    p {
      width: 70%;
      font-size: 10px;
      margin: 0 auto;
      text-align: center;
      color: rgba(0, 0, 0, 0.15);
    }
    .bts {
      margin: 0 auto;
      margin-top: 20px;
      width: 80%;
      display: flex;
      justify-content: space-between;
      .left {
        width: 20%;
        padding: 10px 40px;
        background: linear-gradient(#6f94e8, #5178df);
        border-radius: 6px;
        span {
          display: block;
          width: 100%;
          height: 20px;
          text-align: center;
          color: #fff;
          font-size: 12px;
          line-height: 20px;
        }
      }
      .right {
        width: 20%;
        padding: 10px 40px;
        border: 1px solid rgba(27, 26, 26, 0.12) ;
         border-radius: 6px;
        span {
          display: block;
          width: 100%;
          height: 20px;
          font-size: 12px;
          line-height: 20px;
          font-weight: 700;
          color: #666;
          text-align: center;
        }
      }
    }
  }
}
</style>